package com.jlg.service.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.jlg.beans.user.UserBean;
import com.julewa.db.Identifier;
import com.julewa.db.Store;

@Component
public class UserManager{
	private Store<UserBean> manager = new Store<UserBean>(UserBean.class);
	private @Autowired Identifier idsrv;
	//
	public boolean create(UserBean user){
		long id = idsrv.generate("user");
		user.setID(id);
		return manager.insert(user);
	}
	
	public UserBean find(long id){
		return manager.get(id);
	}
	
	public UserBean findByUserName(String username){
		return null;
	}
	 
}
